<?php
/*
Galaxy
Author:McFog
*/
defined('IN GALAXY') or exit('McFog');

class model_formfield {
	function __construct($name, $type='text', $value='', $other = array()) {
		extract($other);
		unset($other);
		galaxy::extract_to(get_defined_vars(), $this);
	}
	function __get($name) {
		switch($name) {
			case 'inputcode':
				$vars = get_object_vars($this);
				$code = '<input';
				foreach($vars as $k => $v) {
					if($k=='this') continue;
					$v = addslashes($v);
					$code .= " $k='$v'";
				}
				$code .= "/>";
				return $code;
		}
		galaxy::debug('Undefined property via __get()');
		return null;
	}
}

?>